#ifndef _WATCH_H_
# define _WATCH_H_

#include <LOGR_functions.h>

#define WATCH_FUNC_RETURN void
#define WATCH_FUNC_ARGS struct _w3lWatch *watch, log_line *line
#define WATCH_FUNC(name) WATCH_FUNC_RETURN name(WATCH_FUNC_ARGS)


typedef struct _w3lWatch{
	short active;
	int id;
	char *description;
	short arg_is_string;
	void *arg;
	char *status;
	WATCH_FUNC_RETURN(*check)(WATCH_FUNC_ARGS);
} w3lWatch;


w3lWatch *
find_watch(LNode_type *watches, int id);

int
max_watch_id(LNode_type *watches);

void
add_watch(LNode_type *watches, w3lWatch *watch);

short
del_watch(LNode_type *watches, int id);

w3lWatch *
create_watch(char *description, short active, int id, void *arg, short arg_is_string, void(*check)(struct _w3lWatch *watch, log_line *line));

char *
check_watch(w3lWatch *watch);

WATCH_FUNC(w_url);
WATCH_FUNC(w_domain);

#endif
